package genhandle

import (
	"fginTpl/fgin_http_gen/config"
	"fginTpl/fgin_http_gen/globals"
	"fginTpl/utils"
	"path/filepath"
)

// 生成控制器
func GenControllers() {
	tplParams := map[string]string{
		"ProjectName": config.ConfigData.ProjectName,
		"Port":        config.ConfigData.Port,
	}
	// example 例子
	if err := utils.TourchFile(filepath.Join(globals.BASEDIR, "./controllers/public_controller.go"), "./fgin_http_templates/controllers/public_controller.tpl", "publicControllerGoTpl", tplParams); err != nil {
		panic(err)
	}
}
